<template>
  <div>
    <header class="head">
      <div style="font-size: 50px">
        <el-icon @click="goBack"><Back /></el-icon>
      </div>
      <div class="message_title">{{ props.head_title }}</div>
    </header>
    <p class="line" style="background: #f2f2f2"></p>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
// 子组件接受父组件传参
import {defineProps} from 'vue'
const props = defineProps({
  head_title: {
    type: String,
    required: true
  }
})
const router = useRouter()
const goBack = () => {
  router.go(-1)
  // console.log('点击返回上一页')
}

</script>

<style scoped lang="scss">
* {
  margin: 0;
  padding: 0;
}

.head {
  height: 50px;
  line-height: 75px;
  display: flex;
  /* background: red; */
  color: #999;
  position: relative;
}

.message_title {
  color: black;
  position: absolute;
  left: 40%;
  font-size: 17px;
}

.line {
  height: 5px;
  width: 100%;
  margin-top: 5px;
}
</style>
